<?php
/*****
* require BrowseAction
* 首页模块
* 根据实际需要可大改= =
*****/
import('@.Model.Where.EventWhereMachine');
import('@.Model.Extend.EventViewModel');
import('@.Action.Home.BrowseAction');
class IndexAction extends BrowseAction{
    public function index(){        
        $em= new EventViewModel();
        $map= new EventWhereMachine();
        $map->state(EventModel::C('STATE_NORMAL'));
        $map->authorState(AccountModel::C('STATE_NORMAL'));
        $map->isEnded(false);
        $mapGeneral= $map->get();
        
        $map->accountRole(AccountModel::C('ROLE_GROUP'));
        $e= $em->where($map->get())->order('stamp_created DESC')->limit(8)->select();
        $this->assign('groupEvents', $e);
        
        $map->reset($mapGeneral);
        $map->accountRole(AccountModel::C('ROLE_USER_BASIC'));
        //$e=  $em->where($map->get())->order('stamp_created DESC')->limit(6)->select();
        $r = new Model();
	$e=$r->query("select * from `notice_event` where `role`=0 order by `stamp_created` DESC LIMIT 6;");
	$this->assign('userEvents', $e);
        
        $this->assign('types', EventModel::getTypes());
        $this->assign('tags', $this->getHotTag());
        
        $this->assign('groups', $this->getHotGroup());
        
        $this->display('index');
    }
    public function add(){
        echo "hello, this is add()";
    }
}
?>